Builder

@RequiresApi(value = 30)
constructor(@NonNull shortcutId: String)(source)

Creates a BubbleMetadata.Builder based on a ShortcutInfoCompat. To create a shortcut bubble, ensure that the shortcut associated with the provided {@param shortcutId} is published as a dynamic shortcut that was built with setLongLived being true, otherwise your notification will not be able to bubble.

The shortcut icon will be used to represent the bubble when it is collapsed.

The shortcut activity will be used when the bubble is expanded. This will display the shortcut activity in a floating window over the existing foreground activity.

If the shortcut has not been published when the bubble notification is sent, no bubble will be produced. If the shortcut is deleted while the bubble is active, the bubble will be removed.

See also

Throws

if shortcutId is null.


constructor(@NonNull intent: PendingIntent, @NonNull icon: IconCompat)(source)

Creates a BubbleMetadata.Builder based on the provided intent and icon.

The icon will be used to represent the bubble when it is collapsed. An icon should be representative of the content within the bubble. If your app produces multiple bubbles, the icon should be unique for each of them.

The intent that will be used when the bubble is expanded. This will display the app content in a floating window over the existing foreground activity. The intent should point to a resizable activity.

Throws

if icon is null.


constructor()(source)

Deprecated

use Builder for a bubble created via a ShortcutInfoCompat or Builder for a bubble created via a PendingIntent.